//
//  collectvideo.m
//  testvideo
//
//  Created by fcbayern on 2021/1/6.
//  Copyright © 2021 fcbayern. All rights reserved.
//

#import "collectvideo.h"
#import <AVFoundation/AVFoundation.h>
#import <AVKit/AVKit.h>
@interface collectvideo ()

@end

@implementation collectvideo

- (void)viewDidLoad {
    [super viewDidLoad];
    NSURL *webVideoUrl = [NSURL URLWithString:_url];
    //步骤2：创建AVPlayer
    AVPlayer *avPlayer = [[AVPlayer alloc] initWithURL:webVideoUrl];
    //步骤3：使用AVPlayer创建AVPlayerViewController，并跳转播放界面
    AVPlayerViewController *avPlayerVC =[[AVPlayerViewController alloc] init];
    avPlayerVC.player = avPlayer;
    [self presentViewController:avPlayerVC animated:YES completion:nil];
    // Do any additional setup after loading the view.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
